package com.ruoyi.shopping.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.shopping.domain.MallProductSpecsBack;
import com.ruoyi.shopping.mapper.MallProductSpecsBackMapper;
import com.ruoyi.shopping.service.IMallProductSpecsBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 商品规格备份Service业务层处理
 *
 * @author ruoyi
 * @date 2022-07-19
 */
@Service
public class MallProductSpecsBackServiceImpl implements IMallProductSpecsBackService
{
    @Autowired
    private MallProductSpecsBackMapper mallProductSpecsBackMapper;

    /**
     * 查询商品规格备份
     *
     * @param id 商品规格备份主键
     * @return 商品规格备份
     */
    @Override
    public MallProductSpecsBack selectMallProductSpecsBackById(Long id)
    {
        return mallProductSpecsBackMapper.selectMallProductSpecsBackById(id);
    }

    /**
     * 查询商品规格备份列表
     *
     * @param mallProductSpecsBack 商品规格备份
     * @return 商品规格备份
     */
    @Override
    public List<MallProductSpecsBack> selectMallProductSpecsBackList(MallProductSpecsBack mallProductSpecsBack)
    {
        return mallProductSpecsBackMapper.selectMallProductSpecsBackList(mallProductSpecsBack);
    }

    /**
     * 新增商品规格备份
     *
     * @param mallProductSpecsBack 商品规格备份
     * @return 结果
     */
    @Override
    public int insertMallProductSpecsBack(MallProductSpecsBack mallProductSpecsBack)
    {
        mallProductSpecsBack.setCreateTime(DateUtils.getNowDate());
        return mallProductSpecsBackMapper.insertMallProductSpecsBack(mallProductSpecsBack);
    }

    /**
     * 修改商品规格备份
     *
     * @param mallProductSpecsBack 商品规格备份
     * @return 结果
     */
    @Override
    public int updateMallProductSpecsBack(MallProductSpecsBack mallProductSpecsBack)
    {
        mallProductSpecsBack.setUpdateTime(DateUtils.getNowDate());
        return mallProductSpecsBackMapper.updateMallProductSpecsBack(mallProductSpecsBack);
    }

    /**
     * 批量删除商品规格备份
     *
     * @param ids 需要删除的商品规格备份主键
     * @return 结果
     */
    @Override
    public int deleteMallProductSpecsBackByIds(Long[] ids)
    {
        return mallProductSpecsBackMapper.deleteMallProductSpecsBackByIds(ids);
    }


    /**
     * 批量逻辑删除商品规格备份
     *
     * @param ids 需要删除的商品规格备份主键
     * @return 结果
     */
    @Override
    public int logicDeleteMallProductSpecsBack(Long[] ids,String delType,Long delUser)
    {
        return mallProductSpecsBackMapper.logicDeleteMallProductSpecsBack(ids,delType,delUser);
    }

    /**
     * 删除商品规格备份信息
     *
     * @param id 商品规格备份主键
     * @return 结果
     */
    @Override
    public int deleteMallProductSpecsBackById(Long id)
    {
        return mallProductSpecsBackMapper.deleteMallProductSpecsBackById(id);
    }
}
